package com.aruba.controller;

import com.aruba.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StockController {
    @Autowired
    private StockService stockService;

    @GetMapping("/reduceStock")
    public String reduceStock(@RequestParam("id") Integer id) {
        int i = 1 / 0;
        System.out.println("请求来了");
        stockService.reduceStock(id);
        return "减库存成功";
    }

}
